const defaultState = {
  input: "默认的内容"
};
// 纯函数式的reducer
export default (state = defaultState, action) => {
  // 根据动作里的type值来操作具体值的状态
  switch (action.type) {
    case "setInput":
      // 深拷贝
      let newState = JSON.parse(JSON.stringify(state));
      newState.input = action.value;
      return newState;
    default:
      return state;
  }
};
